*SM-F1

version 17

use ../Metadata/tess_analysisdata.dta, clear

keep if insample==1


	lab var mediation "Type: Mediation"
	lab var moderation "Type: Moderation"	
	lab var medtime15 "Median time"
	lab var N_person "Sample size"
	lab var year "Year study fielded"
	

	recode num_measures (1=1) (2/50=0), gen(singleitem)
		gen multiitem=1-singleitem
		lab var singleitem "Single item"
		lab var multiitem "Multiple items"
		
	recode outcome_categories (2=1) (3/8=0), gen(binarydv)
		lab var binarydv "Binary DV"

	
	lab var hyp_true "Hyp.Supported"
	
	lab var type_conj_dce "Conjoint/DCE"
	lab var type_information "Info. prov. exp."
	lab var type_beliefelicit "Belief elicit. exp."
	lab var type_questwording "Quest. wording exp."
	lab var clarity "Clarity"

	recode title (1 2 6=0) (3/5=1), gen(faculty)
		tab faculty

		lab var faculty "Faculty PI"

	tab discipline_collapse, gen(field_)
		gen polsci=field_1
		lab var polsci "Political science"

		
	recode numauthors (1=0) (2/10=1), gen(authors2)
		lab var authors2 "Co-authored"
		
********************************************************************************
corr ///
	hyp_true ///
	N_person singleitem binarydv ///	hypothesis-level
	mediation moderation hyp_t hyp_ks hyp_default ///	
	woman faculty polsci authors2 /// PI attributes
	medtime15 shortstudy /// length
	type_beliefelicit type_conj_dce type_framing type_information type_priming type_questwording type_vignette type_writing /// experiment type
	pilot any_checks clarity 

matrix corrmatrix = r(C)




heatplot corrmatrix, ///
label ///
xlabel(, angle(vertical) labsize(1.7) nogrid) ///
ylabel(, labsize(1.7) nogrid) ///
title("{bf: Correlation Heatplot, hypothesis-level}", size(2.2) span) ///
graphregion(color(white) margin(l=-4)) ///
aspectratio(1) ///
colors(blue midblue eltblue ///
eggshell ///
gold dkorange red ///
, intensity(.9) reverse) ///
cuts(-1 -.75 -.25 -.05 .05 .25 .75 1) drop(0) ///
lower /// display lower triangle only
legend(order (1 "-1 to -.75" 2 "-.75 to -.25" 3 "-.25 to -.05" 4 "-.05 to .05" 5 ".05 to .25" 6 " .25 to .75" 7 ".75 to 1") subtitle(" ") region(lwidth(none)) ) ///
note("Note: N(hypotheses)= 1,012.", size(1.7) span) ///
xsize(6.5) ysize(5.5) 


graph export "../Results/SM-F1-Figure-CorrHeatPlot_hyp.pdf", replace
